//
//  MTWalletApiManager.h
//  MeToo
//
//  Created by 俊松何 on 2018/7/19.
//  Copyright © 2018年 tianxie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MTCoinModel.h"
#import "MTWalletInfo.h"
#import "MTCoinRecordsModel.h"
#import "MTPayOrderModel.h"

@interface MTWalletApiManager : NSObject

@property(nonatomic,strong) MTWalletInfo *walletInfo;
@property(nonatomic,strong) NSMutableArray<MTCoinModel *> *coins;

@property(nonatomic,assign) double rate;

@property(nonatomic,weak) UIViewController *fromVc;

+(instancetype)manager;


-(void)pushSetPasswordVcFromVc:(UIViewController *)curentVc;

/**
 获取用户的币的列表

 @param completionBlock 完成block
 */
-(void)getUserCoinsWithcomplation:(void (^)(NSMutableArray<MTCoinModel *> *coins ,MTError *boerror))completionBlock;



/**
 获取用户的钱包信息

 @param completionBlock 完成block
 */
-(void)getUserWalletInfoWithcomplation:(void (^)(MTWalletInfo *walletInfo ,MTError *boerror))completionBlock;


/**
 获取钱包记录

 @param symobl symbol
 @param page 页数
 @param completionBlock 完成block
 */
-(void)getRecordsWithSymbol:(NSString *)symobl
                       page:(int)page
                 complation:(void (^)(MTCoinRecordsTotalModel *totalRecords ,MTError *boerror))completionBlock;



/**
 创建钱包 创建钱包

 @param symbol 符号
 @param targetUserId 目标userId
 @param value 大赏值
 @param workId 作品ID
 @param completionBlock 完成block
 */
-(void)createRewardWithSymbol:(NSString *)symbol
                 targetUserId:(NSString *)targetUserId
                        value:(NSString *)value
                       workId:(NSString *)workId
                   complation:(void (^)(NSString  *orderId ,MTError *boerror))completionBlock;


/**
 设置钱包密码

 @param password 密码
 @param phone 手机号
 @param code 验证吗
 @param countryCode 国家编码
 @param completionBlock 完成block
 */
-(void)setWalletWithPassword:(NSString *)password
                       phone:(NSString *)phone
                        code:(NSString *)code
                 countryCode:(NSString *)countryCode
                  complation:(void (^)(MTError *error))completionBlock;



/**
 打赏支付接口

 @param orderId orderId
 @param passworld 密码
 @param commplationBlock 完成block
 */
-(void)comfirmRewardWithorderId:(NSString *)orderId
                      passworld:(NSString *)passworld
                     complation:(void(^)(NSString *orderId, MTError *error))commplationBlock;



/**
 获取充值汇率

 @param commplationBlock 完成block
 */
-(void)getRechargeRatecomplation:(void(^)(double rate, MTError *error))commplationBlock;

/**
 创建支付订单
 
 @param symbol symbol
 @param value value
 @param complationBlock 完成block
 */
-(void)createRechargeWithSymbol:(NSString *)symbol
                          value:(NSString *)value
                     complation:(void(^)(MTPayOrderModel *payOrder, MTError *error))complationBlock;

@end
